import { defineStore } from 'pinia'
import Mock from "mockjs";

export const useSearchStore = defineStore('searchStore', {
    // 推荐使用 完整类型推断的箭头函数
    state: () => {
        return {
            // 所有这些属性都将自动推断其类型
            searchList: Mock.mock({
                "searchList|2000": [
                    {
                        img: "@Image('100x100','@color','@cname')",
                        name: "@cname(4)",
                        price: "@num",
                        "id|+1": 0,
                    },
                ],
            })
        }
    },
})